Waste less time with non-directories. (#391725, Chris Wilson)
authorMatthias Clasen <mclasen@redhat.com>
Tue, 2 Jan 2007 04:19:28 +0000 (04:19 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 2 Jan 2007 04:19:28 +0000 (04:19 +0000)
2007-01-01  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkicontheme.c (load_themes): Waste less time
        with non-directories.  (#391725, Chris Wilson)

svn path=/trunk/; revision=17005

ChangeLog
gtk/gtkicontheme.c

index ff0cd103a07c55b09671a268bbe19fc97a107112..cf847175f2651d0118e9231d485b93a235ad64f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-01  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkicontheme.c (load_themes): Waste less time
+       with non-directories.  (#391725, Chris Wilson)
+
 2007-01-01  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkcellrendererprogress.c: Implement activity mode
index e986b400612c78b3ea6a45e8f9d2b07448593f55..6cb06aeb7bc175f5a5506030ae17c5c1658e8e0d 100644 (file)
@@ -1047,20 +1047,21 @@ load_themes (GtkIconTheme *icon_theme)
       dir = icon_theme->priv->search_path[base];
 
       dir_mtime = g_slice_new (IconThemeDirMtime);
-      dir_mtime->cache = _gtk_icon_cache_new_for_path (dir);
-      dir_mtime->dir = g_strdup (dir);
-      if (g_stat (dir, &stat_buf) == 0 && S_ISDIR (stat_buf.st_mode))
-       dir_mtime->mtime = stat_buf.st_mtime;
-      else
-       dir_mtime->mtime = 0;
-      
       priv->dir_mtimes = g_list_append (priv->dir_mtimes, dir_mtime);
       
+      dir_mtime->dir = g_strdup (dir);
+      dir_mtime->mtime = 0;
+      dir_mtime->cache = NULL;
+
+      if (g_stat (dir, &stat_buf) != 0 || !S_ISDIR (stat_buf.st_mode))
+       continue;
+      dir_mtime->mtime = stat_buf.st_mtime;
+
+      dir_mtime->cache = _gtk_icon_cache_new_for_path (dir);
       if (dir_mtime->cache != NULL)
        continue;
 
       gdir = g_dir_open (dir, 0, NULL);
-
       if (gdir == NULL)
        continue;